//setup namespace for functions
var xfutils = {};

// returns the value of the named cookie
xfutils.getCookie = function(c_name){
	var i,x,y,ARRcookies=document.cookie.split(";");
	for (i=0;i<ARRcookies.length;i++){
		x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
		y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
		x=x.replace(/^\s+|\s+$/g,"");
		if (x==c_name){
			return unescape(y);
		}
	}
};

/**
 * Checks to see if a string is null or empty string
 * 
 * @param s string to test
 */
xfutils.isEmpty = function(s)
{
	return ((s == null) || (s.length == 0));
};

/**
 * Checks to see if a string is whitespace
 * 
 * @param s string to test
 */
xfutils.isWhitespace = function(s){   
	// Is s empty?
	var reWhitespace = /^\s+$/;
    return reWhitespace.test(s);
};

/**
 * Checks to see if a string is null, empty string or whitespace
 * 
 * @param s string to test
 */
xfutils.isBlank = function(s){   
    return (xfutils.isEmpty(s) || xfutils.isWhitespace(s));
};